package com.senchen365.oam.servlet;

import com.senchen365.orm.service.OrderService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * <p> Title: OrderService </p>
 * <p> Description: TODO (一句话描述功能) </p>
 *
 * @author ： 寇超
 * @version ：  1.00
 * 修改记录 ：
 *
 * <pre>
 * 版本   修改人    修改时间    修改内容描述
 * ----------------------------------------
 *
 * </pre>
 * @date： 2021/11/30 0030
 */
@WebServlet("/myweb")
public class OrderServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        OrderService orderService=new OrderService();
        String msg=orderService.getMsg();
        resp.setCharacterEncoding("utf-8");
        resp.setContentType("text/html; charset=UTF-8");
        PrintWriter out=resp.getWriter();
        out.println("<h2 style='color:red'>"+msg+"</h2>");
        out.flush();
        out.close();
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}
